<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title th:text="${session.settings.mainTitle}"></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/ico" th:href="@{/static/img/favicon.ico}">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="UyBlog"/>
    <meta name="msapplication-TileColor" content="#0e90d2">
    <link rel="stylesheet" th:href="@{/static/css/amazeui.min.css}">
    <link rel="stylesheet" th:href="@{/static/css/app.css}">
</head>

<body id="blog">
<!--公共头部开始-->
<div th:replace="/front/head :: head (index=1)">
</div>
<!--公共头部结尾-->

<!-- banner start -->
<div class="am-g am-g-fixed blog-fixed am-u-sm-centered blog-article-margin">
    <div data-am-widget="slider" class="am-slider am-slider-b1" data-am-slider='{&quot;controlNav&quot;:false}'>
        <ul class="am-slides">
            <li th:each="item : ${session.settings.viewCarousel.viewCarousels}">
                <img th:src="@{${item.href}}">
                <div class="blog-slider-desc am-slider-desc ">
                    <div class="blog-text-center blog-slider-con">
                        <span><a class="blog-color" th:utext="${session.myAccount.name}+' &nbsp;'">Tip &nbsp;</a></span>
                        <h1 class="blog-h-margin"><a href="" th:text="${item.title}"></a></h1>
                        <p th:text="${item.detail}">
                        </p>
                        <!-- <span class="blog-bor">2015/10/9</span>-->
                        <br><br><br><br><br><br><br>
                    </div>
                </div>
            </li>
        </ul>
    </div>
</div>
<!-- banner end -->
<!-- content srart -->
<div class="am-g am-g-fixed blog-fixed">
    <div class="am-u-md-8 am-u-sm-12">

        <!--主item展示-->
        <article class="am-g blog-entry-article">
            <div class="am-u-lg-12 am-u-md-12 am-u-sm-12 am-u-sm-centered blog-entry-img">
                <img alt="" class="am-u-sm-12 am-img-responsive am-thumbnail">
            </div>
            <div class="am-u-lg-12 am-u-md-12 am-u-sm-12 blog-entry-text blog-text-center"
             th:if="${!data.data.list.isEmpty()}"    th:object="${data.data.getList().get(0)}">
                <span><a class="blog-color" th:text="'阅读量: '+*{readCount}"></a></span>
                <span th:text="'@'+${session.myAccount.name}+'&nbsp;'"> </span>
                <span th:text="*{#dates.format(createTime,'yyyy/MM/dd')}">2015/10/9</span>
                <h1><a th:href="@{'/main/detail/'+ *{id}}" target="_blank"
                       th:text="*{title}"></a></h1>
                <p class="am-text-truncate" th:text="*{detail}">
                </p>
                <p>
                    <a href="" class="blog-continue">continue reading</a>
                </p>
            </div>
        </article>
        <!--主item展示结尾-->

        <!--文字列表的开始处-->
        <article class="am-g blog-entry-article" th:each="item,index : ${data.data.getList()}"
                 th:if="${index.index!=0}">
            <div class="am-u-lg-6 am-u-md-12 am-u-sm-12 blog-entry-img">
                <img th:src="@{/static/i/f12.jpg}" alt="" class="am-u-sm-12 am-thumbnail">
            </div>
            <div class="am-u-lg-6 am-u-md-12 am-u-sm-12 blog-entry-text">
                <span><a class="blog-color" th:text="'阅读量: '+${item.readCount}+'&nbsp;'"></a></span>
                <span th:utext="'@'+${session.myAccount.name}+' &nbsp;'"></span>
                <span th:text="${#dates.format(item.createTime,'yyyy/MM/dd')}">2015/10/9</span>
                <h1><a th:href="@{'/main/detail/'+${item.id}}" target="_blank"
                       th:text="${item.title}">世间所有的相遇，都是久别重逢。</a></h1>
                <p th:text="${item.detail}"
                   style="display: -webkit-box;-webkit-line-clamp: 3;-webkit-box-orient: vertical;overflow: hidden;">
                    内容的大概预览部分
                </p>
            </div>
        </article>
        <!--文字列表的结束处-->

        <ul class="am-pagination">
            <li class="am-pagination-prev" th:classappend="${!data.data.hasPreviousPage}?'am-disabled'">
                <a class="disabled" th:href="@{'/main/index/' +${data.data.prePage}}">&laquo; 上一页</a>
            </li>
            <li class="am-pagination-next" th:classappend="${!data.data.hasNextPage}?'am-disabled'">
                <a th:href="@{'/main/index/' +${data.data.nextPage}}">下一页 &raquo;</a>
            </li>
        </ul>
    </div>

    <!--右边的简介说明-->
    <div th:replace="/front/about :: about"></div>
</div>
<!--底部-->
<div th:replace="/front/footer :: footer"></div>
<!--[if (gte IE 9)|!(IE)]><!-->
<script th:src="@{/static/js/jquery.min.js}"></script>
<script th:src="@{/static/js/amazeui.min.js}"></script>

<script type="text/javascript" th:src="@{/static/js/jquery.goup.min.js}"></script>

</body>
<script type="text/javascript" th:inline="javascript">
    function random() {
        /*<![CDATA[*/
        var param = /*[[${session.settings.viewContentItem}]]*/ null;
        /*]]>*/
        var max = [[${session.settings.viewContentItem.size}]] - 1;
        var min = 0;
        var index = parseInt(Math.random() * (max - min + 1) + min);
        return param.href[index];
    }


    function setImageSrc() {
        $('article').each(function () {
            $(this).find('img').each(function () {
                this.src = random();
            });
        });
    }

    $(window).load(function () {
        setImageSrc();
    });
</script>
</html>